<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>自动分配金额输入</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<script>
    $(function(){
        $("#buOrgCd").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            isMultiSelect: true,
            isShowCheckBox: true
        });
        liger.get("buOrgCd").setData(${orgListList});
        $("#insCode").ligerComboBox({
            valueField: 'key',
            textField: 'value',
            isMultiSelect: true,
            isShowCheckBox: true
        });
        liger.get("insCode").setData(${insList});
    })
</script>
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
              <div class="fieldset1 tabel_col  clearFix noBorder">
                <div class="fieldBox col_50">
                    <div class="label">分配金额上限</div>
                    <div class="field">
                        <input name="money" id="money" type="text" class="ui-textbox" value="">
                    </div>
                </div>
                  <div class="fieldBox col_50" id="searchmcrCd">
                      <div class="label">是否小贷业务</div>
                      <div class="field">
                          <select name="mcrCd" id="mcrCd">
                              <option value="2">全部</option>
                              <option value="1">内部</option>
                              <option value="0">外部</option>
                          </select>
                      </div>
                  </div>
                  <div class="fieldBox col_50" id="bizFlagBox">
                      <div class="label">是否资管业务</div>
                      <div class="field">
                          <select name="bizFlag" id="bizFlag">
                              <option value="2">全部</option>
                              <option value="1">是</option>
                              <option value="0">否</option>
                          </select>
                      </div>
                  </div>
				<div class="fieldBox col_50" id="searchBuOrgCdId">
					<div class="label">所属事业部</div>
					<div class="field">
                        <input name="buOrgCd" id="buOrgCd" placeholder="请选择" ltype="combobox">
					</div>
				</div>
                <div class="fieldBox col_50" id="insCodeBox">
                  <div class="label">第三方机构</div>
                  <div class="field">
                      <input name="insCode" id="insCode" placeholder="请选择" ltype="combobox">
                  </div>
                </div>
                <div class="fieldBox col_50">
                  <div class="label">逾期天数</div>
                  <div class="field">
                      <input ligerui="width: 80" name="ovdDaysMin" id="ovdDaysMin" type="text" class="ui-textbox"
                             value="" validate="{number:true}">
                      -
                      <input ligerui="width: 80" name="ovdDaysMax" id="ovdDaysMax" type="text" class="ui-textbox"
                             value="" validate="{number:true}">
                  </div>
                </div>
               <div class="formBtns col_100">
                    <span id="assignBtn" class="sq-button-round">指定分配人员</span>
               </div>
               
            </div>
           
        </form>
    </div>
    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var valid= false;
    $(function(){
        $("#money").change(function(){
            var val = $(this).val();
            if(val){
                if(val > 5000000){
                    valid=false;
                    alert("自动分配金额不允许大于500万")
                }else{
                    valid=true;
                }
            }
        })
        $("#assignBtn").click(function(){
            if(valid){
            	
            	var buOrgCd=$("#buOrgCd").ligerGetComboBoxManager().getValue()
            	var startAppoDt=$("#ovdDaysMin").val();
            	var endAppoDt=$("#ovdDaysMax").val();
            	var money=$("#money").val();
            	var mcrCd=$("#mcrCd").val();
            	var bizFlag=$("#bizFlag").val();
                var insCode = $("#insCode").ligerGetComboBoxManager().getValue()
                parent.parent.mainApp.f_addTab('tab_rsk_usr_list','分配','<%=path%>/risknew/rskUsrCstR/autoAssign/toUsrList.do?age=${age}&money=' 
                +money+'&buOrgCd='+buOrgCd+'&ovdDaysMin='+startAppoDt+'&ovdDaysMax='+endAppoDt + '&mcrCd='+mcrCd + '&bizFlag=' + bizFlag + '&insCode=' + insCode);
            }
        });
    });
</script>

</body>
</html>
